package com.nav.test;

import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;

import javax.imageio.ImageIO;

public class ImageGenerator {
	/**
	 * @param args
	 * @throws IOException 
	 */
	public static void main(String[] args) throws IOException {
		for(int x = 0; x < 256; x++) {
			BufferedImage redImage = new BufferedImage(256, 256, BufferedImage.TYPE_INT_RGB), greenImage = new BufferedImage(256, 256, BufferedImage.TYPE_INT_RGB), blueImage = new BufferedImage(256, 256, BufferedImage.TYPE_INT_RGB);
			for(int y = 0; y < 256; y++) {
				for(int z = 0; z < 256; z++) {
					redImage.setRGB(y, z, (x * 256 + y) * 256 + z);
					greenImage.setRGB(y, z, (z * 256 + x) * 256 + y);
					blueImage.setRGB(y, z, (y * 256 + z) * 256 + x);
				}
			}
			ImageIO.write(redImage, "png", new File("images/red" + x + ".png"));
			ImageIO.write(greenImage, "png", new File("images/green" + x + ".png"));
			ImageIO.write(blueImage, "png", new File("images/blue" + x + ".png"));
		}
	}
}
